//日志等级类
//1.DEBUG   2.INFO  3.WARNING    4.ERROR    5.FATAL

#ifndef _M_LEVEL_H__
#define _M_LEVEL_H__

namespace bitlog{
    class Loglevel{
        public:
        enum class value{
            DEBUG,
            INFO,
            WARNING,
            ERROR,
            FATAL
        };
        static const char* toString(Loglevel::value level){
            switch(level){
                #define TOSTRING(name) #name
                case Loglevel::value::DEBUG: return TOSTRING(DEBUG);
                case Loglevel::value::INFO: return TOSTRING(INFO);
                case Loglevel::value::WARNING: return TOSTRING(WARNING);
                case Loglevel::value::ERROR: return TOSTRING(ERROR);
                case Loglevel::value::FATAL: return TOSTRING(FATAL);
                #undef TOSTRING
                default: return "unknow";
            }
            return "unknow";
        }
    };
}

#endif